// 220105 2031

// 写入时 追加文件内容
// {'flags': 'a'}

var fs = require('fs');

var src = '22M01/file/input01042245.txt';
var dest = 'd:\\append0105x5.txt';

var read = fs.createReadStream(src);
// 写入了5次:多次执行时，只有本次执行的结果
// var write = fs.createWriteStream(dest);
// 多次执行时，会有多次执行的结果写入——和上面的区别
var write = fs.createWriteStream(dest, {'flags': 'a'});

// 写入5次
read.pipe(write);
read.pipe(write);
read.pipe(write);
read.pipe(write);
read.pipe(write);

console.log('END.20');
